package cn.tedu._06interceptor.base.config;

import cn.tedu._06interceptor.base.interceptors.Myintercrptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class InterCeptorConfig implements WebMvcConfigurer {
    @Override

    public void addInterceptors(InterceptorRegistry registry) {
        // 添加拦截器
        registry.addInterceptor(new Myintercrptor())
                .addPathPatterns("/v1/user/login","/v1/user/logout");
    }
}
